package com.henry.others;

public class Corporation {
    public static double calcSalary(double standardSalaryPerHour, int workingHours) {
        double salary = 0;
        if (standardSalaryPerHour < 8) System.out.println("The standard salary is too low!");
        if (workingHours < 0) {
            System.out.println("Illegal working hours.");
        }
        else if (workingHours < 40) {
            salary = standardSalaryPerHour * workingHours;
        }
        else if (workingHours < 60) {
            salary = salary + 40 * standardSalaryPerHour;
            salary = salary + (workingHours - 40) * 1.5 * standardSalaryPerHour;
        }
        else System.out.println("Too many working hours!");
        return salary;
    }
    public static void main(String[] args) {
        double[] employeeSalary = new double[3];
        employeeSalary[0] = Corporation.calcSalary(7.50,35);
        employeeSalary[1] = Corporation.calcSalary(8.20,47);
        employeeSalary[2] = Corporation.calcSalary(10.00,73);
    }
}
